import React from 'react'
import { ViewStyle, StyleSheet, TouchableOpacity } from 'react-native'
import { translateSize, themeColors } from 'styles'
import { operate } from 'services/authorization';

export interface RadiusButtonProps {
	style?: ViewStyle
	onPress: () => void
}

const RadiusButton: React.FC<RadiusButtonProps> = props => {
	return (
		<TouchableOpacity style={[styles.container, props.style]} onPress={() => { operate(); props.onPress(); }}>
			{props.children}
		</TouchableOpacity>
	)
}

interface RadiusButtonStyle {
	container: ViewStyle
}

const styles = StyleSheet.create<RadiusButtonStyle>({
	container: {
		flexDirection: 'column',
		alignItems: 'center',
		justifyContent: 'center',
		width: '100%',
		borderRadius: translateSize(10),
		height: translateSize(77),
		backgroundColor: themeColors.primary,
	},
})

export default RadiusButton
